package com.zut.subject.common.enums;

import lombok.Getter;

@Getter
public enum SubjectTypeEnum {
    RADIO(1,"单选题"),
    MULTIPLE(2,"多选题"),
    BRIEF(3,"简答题"),
    JUDGE(4,"判断题");


    private Integer code;
    private String desc;

    SubjectTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SubjectTypeEnum getByCode(int codeVal) {
        for (SubjectTypeEnum result : SubjectTypeEnum.values()) {
            if (result.code==codeVal){
                return result;
            }
        }
        return null;
    }

}
